package reflect;

import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.sql.SQLOutput;
import java.util.Arrays;

public class ReflectDemo6 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("reflect.Person");
        Method method = cls.getMethod("say", String.class, int.class);
        String name = method.getName();
        System.out.println("方法名:" + name);

        Class returnType = method.getReturnType();
        System.out.println("返回值类型" + returnType);

        Class[] parameterTypes = method.getParameterTypes();
        System.out.println("参数类型:" + Arrays.toString(parameterTypes));

    }
}
